import router from './router'

//前置路由
router.beforeEach((to, from, next) => {
	if (to.path === '/login') {
		next()
	} else {
		const token = sessionStorage.getItem('token')
		if (!token) {
			next('/login')
		} else {
			next()
		}
	}
})

export default router
